﻿// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

using System;

namespace NSQL.Expressions.Functions
{
    public class NowFunction : BaseExpression, INowFunction
    {
        internal static readonly NowFunction Instance = new NowFunction(); 
        public override T Accept<T>(IExpressionVisitor<T> visitor) => visitor.Visit(this);
        public override void Accept(IExpressionVisitor visitor) => visitor.Visit(this);
        public override bool IsValid => true;
        protected override IExpression DeepCopy()
        {
            return Instance;
        }

        public object Eval() => DateTime.Now;
    }
}